<?php

namespace IDock\Insurance\DBIC\Request;

use IDock\Insurance\DBIC\DBICEnums;
use IDock\Insurance\DBIC\Response\VehicleActualValueResponse;
use IDock\Visitor\VehicleActualValueVisitor;

class VehicleActualValueRequest extends AllDBICRequest
{
    protected $route = 'dbic/callout/calculaCar/calcula';

    protected $response = VehicleActualValueResponse::class;

    protected $urlTip = '计算车辆实际价值接口';

    /*** @var  VehicleActualValueVisitor $visitor */
    protected $visitor;

    public function generate(): array
    {
        return [
            'clauseType' => '01',
            'enrollDate' => $this->visitor->firstRegisterDate,
            'startDate' => date('Y-m-d',strtotime($this->visitor->startDate)),
            'riskCode' => DBICEnums::$VCI,
            'useNatureCode' => DBICEnums::$causeType[$this->visitor->causeType],
            'seatCount' => $this->visitor->vehicleSeat,
            'tonCount' => $this->visitor->vehicleTonnage ?: '0.0',
            'carKindCode' => DBICEnums::$carKindCode[$this->visitor->carKindCode],
            'purchasePrice' => $this->visitor->vehiclePrice,
            'newDeviceFlag' => '',
            'sumDeviceValue' => '',
            'fuelType' => '',
        ];
    }
}
